Skip to main content
POST
/
v2
/
subscriptions
/
transitions
/
{id}
/
cancel
Cancel subscription transition
curl --request POST \
  --url https://api.hyperline.co/v2/subscriptions/transitions/{id}/cancel \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.hyperline.co/v2/subscriptions/transitions/{id}/cancel"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.text)
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.hyperline.co/v2/subscriptions/transitions/{id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.hyperline.co/v2/subscriptions/transitions/{id}/cancel",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.hyperline.co/v2/subscriptions/transitions/{id}/cancel"

req, _ := http.NewRequest("POST", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.hyperline.co/v2/subscriptions/transitions/{id}/cancel")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.hyperline.co/v2/subscriptions/transitions/{id}/cancel")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "id": "<string>",
  "customer_id": "<string>",
  "base_subscription_id": "<string>",
  "source_subscription_id": "<string>",
  "target_subscription_id": "<string>",
  "transitioned_at": "2023-12-25",
  "name": "<string>",
  "transition_date": "2023-12-25"
}
{
"message": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Response

id
string
required

The unique identifier of the subscription transition

customer_id
string
required

The ID of the customer associated with the transition

base_subscription_id
string
required

The ID of the original subscription from which this transition is derived. It references the last active version of the subscription.

source_subscription_id
string
required

The ID of the subscription to transition from

target_subscription_id
string | null
required

The ID of the subscription to transition to

status
enum<string>
required

The current status of the subscription transition. Possible values are 'scheduled', 'completed', 'failed', and 'draft'.

Available options:
scheduled,
completed,
failed,
draft,
cancelled,
pending_quote_signature
transitioned_at
string<date> | null
required

The date and time when the transition was completed. Null if the transition is not yet completed. UTC date time string in the ISO 8601 format.

name
string | null
required

An optional name for the transition

transition_date
string<date> | null
required

The date at which the transition should occur. Only applicable if the application schedule is 'scheduled'. Can be a past date within the current billing period. UTC date time string in the ISO 8601 format.

application_schedule
enum<string>
required

When the transition should be applied: 'immediately', 'scheduled' for a specific date, or 'last_renewal' to apply it retroactively to the start of the current billing period (refunding what was already invoiced for that period and re-charging the new configuration). Past dates within the current billing period are supported and will be applied immediately.

Available options:
immediately,
scheduled,
next_renewal,
last_renewal,
quote_signature,
scheduled_after_quote_signature
billing_cycle_transition_method
enum<string> | null
required

The billing cycle transition method to use. 'keep_current_billing_cycle' will keep the current billing cycle dates if possible. 'align_to_new_billing_cycle' will align the billing cycle to the transition date.

Available options:
keep_current_billing_cycle,
align_to_new_billing_cycle
calculation_method
enum<string> | null
required

The calculation method to use for the transition. 'do_not_charge' will not generate any transition invoice. 'pro_rata' will generate a prorated invoice for the remaining period. 'refund_and_reinvoice' (only available with application_schedule 'last_renewal') issues a credit note for what was invoiced for the current period and a separate invoice for the new configuration.

Available options:
do_not_charge,
pro_rata,
refund_and_reinvoice